cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME AUST_RM_VISION_2022)
set(SINGLE_TRACK single_track)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
project(${PROJECT_NAME})
set(CMAKE_CXX_STANDARD 11)

MESSAGE(STATUS "on ${CMAKE_SYSTEM_PROCESSOR}")
find_package(OpenCV 3.4 REQUIRED)
find_package(Ceres REQUIRED)

include_directories(${CERES_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(/opt/MVS/include/)
include_directories(include/)

file(GLOB_RECURSE source_files "include/*.cpp")
list(REMOVE_ITEM source_files "exclude")

if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
        link_directories(/opt/MVS/lib/64/)
        file(GLOB_RECURSE remove_files "include/MatcherCuda.cpp" "main_cuda.hpp")
        list(REMOVE_ITEM source_files ${remove_files})
        add_executable(${PROJECT_NAME} main.cpp main_default.hpp ${source_files})
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
        link_directories(/opt/MVS/lib/aarch64/)
        add_executable(${PROJECT_NAME} main.cpp main_cuda.hpp ${source_files})
endif ()

#add_executable(${PROJECT_NAME} main.cpp ${source_files} main_default.hpp main_cuda.hpp)


target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
target_link_libraries(${PROJECT_NAME} ${CERES_LIBRARIES})
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
MvCameraControl
MVRender
MVGigEVisionSDK
X11
MvUsb3vTL
MediaProcess
#GCBase_gcc421_v3_0
#GenApi_gcc421_v3_0
#log4cpp_gcc421_v3_0
#Log_gcc421_v3_0
#MathParser_gcc421_v3_0
#NodeMapData_gcc421_v3_0
#XmlParser_gcc421_v3_0
)